package com.ecb.business.controller;

import com.ecb.business.dto.api.ApiResult;
import com.ecb.business.dto.chainExec.ChainQueryDTO;
import com.ecb.business.dto.chainExec.SubscribeTradeDTO;
import com.ecb.business.service.ChainExecService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("chainExec")
@Api(tags = "合约执行")
public class ChainExecController {

    @Autowired
    ChainExecService chainExecService;

    @PostMapping("getChainDetail")
    @ApiOperation(value = "获取区块链详细情况",notes = "")
    public ApiResult getAllOrg(@RequestBody ChainQueryDTO queryDTO){
        return ApiResult.T(chainExecService.getChainDetail(queryDTO));
    }
    @PostMapping("subscribeTrade")
    @ApiOperation(value = "订阅交易",notes = "")
    public ApiResult subscribeTrade(@RequestBody SubscribeTradeDTO subscribeTradeDTO){
        return ApiResult.T(chainExecService.subscribeTrade(subscribeTradeDTO));
    }


}
